<%@page import="tx.bjdacp.model.*" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib tagdir="/WEB-INF/tags/simpletable" prefix="simpletable"%>
<%@ include file="/commons/taglibs.jsp" %>

<rapid:override name="head">
	<title><%=SampleInfo.TABLE_ALIAS%> 维护</title>

	<link href="<c:url value="/widgets/simpletable/simpletable.css"/>" type="text/css" rel="stylesheet">
	<script type="text/javascript" src="<c:url value="/widgets/simpletable/simpletable.js"/>"></script>

	<script type="text/javascript" >
		$(document).ready(function() {
			// 分页需要依赖的初始化动作
			window.simpleTable = new SimpleTable('queryForm',${page.thisPageNumber},${page.pageSize},'${pageRequest.sortColumns}');
		});
	</script>
</rapid:override>

<rapid:override name="content">
<s:bean name="tx.bjdacp.service.DataDictManager" var="dataDictManager" ></s:bean>
	<form id="queryForm" name="queryForm" action="<c:url value="/pages/SampleInfo/list.do"/>" method="post" style="display: inline;">
	<s:hidden id="drugSellUnitId" name="drugSellUnitId" />
	<div class="queryPanel">
		<fieldset>
			<legend>搜索</legend>
			<table>
				<tr>

					<td class="tdLabel"><%=SampleInfo.ALIAS_SAMPLE_NUMBER%></td>
					<td>
						<input value="${query.sampleNumber}" id="sampleNumber" name="sampleNumber" maxlength="100"  class=""/>
					</td>
					<td class="tdLabel"><%=SampleInfo.ALIAS_SAMPLE_DATE%></td>
					<td>
						<input value="<fmt:formatDate value='${query.sampleDateBegin}' pattern='<%=SampleInfo.FORMAT_SAMPLE_DATE%>'/>" onclick="WdatePicker({dateFmt:'<%=SampleInfo.FORMAT_SAMPLE_DATE%>'})" id="sampleDateBegin" name="sampleDateBegin"   />
						<input value="<fmt:formatDate value='${query.sampleDateEnd}' pattern='<%=SampleInfo.FORMAT_SAMPLE_DATE%>'/>" onclick="WdatePicker({dateFmt:'<%=SampleInfo.FORMAT_SAMPLE_DATE%>'})" id="sampleDateEnd" name="sampleDateEnd"   />
					</td>
					<td class="tdLabel"><%=SampleInfo.ALIAS_SAMPLED_UNIT_NAME%></td>
					<td>
						<input value="${query.sampledUnitName}" id="sampledUnitName" name="sampledUnitName" maxlength="100"  class=""/>
					</td>
				</tr>
				<tr>
					<td class="tdLabel"><%=SampleInfo.ALIAS_UNIT_KIND%></td>
					<td>
						<input value="${query.unitKind}" id="unitKind" name="unitKind" maxlength="100"  class=""/>
					</td>
					<td class="tdLabel"><%=SampleInfo.ALIAS_SAMPLE_UNIT%></td>
					<td>
						<input value="${query.sampleUnit}" id="sampleUnit" name="sampleUnit" maxlength="100"  class=""/>
					</td>
					<td class="tdLabel"><%=SampleInfo.ALIAS_SAMPLE_PRODUCT%></td>
					<td>
						<input value="${query.sampleProduct}" id="sampleProduct" name="sampleProduct" maxlength="100"  class=""/>
					</td>
					<td class="tdLabel"><%=SampleInfo.ALIAS_PRODUCT_TYPE%></td>
					<td>
						<input value="${query.productType}" id="productType" name="productType" maxlength="100"  class=""/>
					</td>
				</tr>
				<tr>
					<td class="tdLabel"><%=SampleInfo.ALIAS_AMOUNT%></td>
					<td>
						<input value="${query.amount}" id="amount" name="amount" maxlength="100"  class=""/>
					</td>
					<td class="tdLabel"><%=SampleInfo.ALIAS_BATCH_NUMBER%></td>
					<td>
						<input value="${query.batchNumber}" id="batchNumber" name="batchNumber" maxlength="100"  class=""/>
					</td>
					<td class="tdLabel"><%=SampleInfo.ALIAS_SAMPLE_KIND%></td>
					<td>
						<input value="${query.sampleKind}" id="sampleKind" name="sampleKind" maxlength="100"  class=""/>
					</td>
					<td class="tdLabel"><%=SampleInfo.ALIAS_REPORT_NUMBER%></td>
					<td>
						<input value="${query.reportNumber}" id="reportNumber" name="reportNumber" maxlength="100"  class=""/>
					</td>
				</tr>
				<tr>
					<td class="tdLabel"><%=SampleInfo.ALIAS_REPORT_DATE%></td>
					<td>
						<input value="<fmt:formatDate value='${query.reportDateBegin}' pattern='<%=SampleInfo.FORMAT_REPORT_DATE%>'/>" onclick="WdatePicker({dateFmt:'<%=SampleInfo.FORMAT_REPORT_DATE%>'})" id="reportDateBegin" name="reportDateBegin"   />
						<input value="<fmt:formatDate value='${query.reportDateEnd}' pattern='<%=SampleInfo.FORMAT_REPORT_DATE%>'/>" onclick="WdatePicker({dateFmt:'<%=SampleInfo.FORMAT_REPORT_DATE%>'})" id="reportDateEnd" name="reportDateEnd"   />
					</td>
					<td class="tdLabel"><%=SampleInfo.ALIAS_REPORT_RESULT%></td>
					<td>
						<input value="${query.reportResult}" id="reportResult" name="reportResult" maxlength="100"  class=""/>
					</td>
					<td class="tdLabel"><%=SampleInfo.ALIAS_RECEIVE_REPORT_DATE%></td>
					<td>
						<input value="<fmt:formatDate value='${query.receiveReportDateBegin}' pattern='<%=SampleInfo.FORMAT_RECEIVE_REPORT_DATE%>'/>" onclick="WdatePicker({dateFmt:'<%=SampleInfo.FORMAT_RECEIVE_REPORT_DATE%>'})" id="receiveReportDateBegin" name="receiveReportDateBegin"   />
						<input value="<fmt:formatDate value='${query.receiveReportDateEnd}' pattern='<%=SampleInfo.FORMAT_RECEIVE_REPORT_DATE%>'/>" onclick="WdatePicker({dateFmt:'<%=SampleInfo.FORMAT_RECEIVE_REPORT_DATE%>'})" id="receiveReportDateEnd" name="receiveReportDateEnd"   />
					</td>
					<td class="tdLabel"><%=SampleInfo.ALIAS_SAMPLE_YEAR%></td>
					<td>
					<s:select   list="#dataDictManager.findAllByTypeYear()"
				                key="sampleYear" theme="simple" headerKey=""  headerValue="请选择..." listValue="ddName" listKey="ddValue"/>
					</td>
				</tr>
			</table>
		</fieldset>
		<div class="handleControl">
			<input type="submit" class="stdButton" style="width:80px" value="查询" onclick="getReferenceForm(this).action='${ctx}/pages/SampleInfo/list.do'"/>
			<!--<input type="submit" class="stdButton" style="width:80px" value="新增" onclick="getReferenceForm(this).action='${ctx}/pages/SampleInfo/create.do'"/>-->
			<input type="button" class="stdButton" style="width:80px" value="删除" onclick="batchDelete('${ctx}/pages/SampleInfo/delete.do','items',document.forms.queryForm)"/>
			    	<input type="submit" class="stdButton" style="width:80px" value="导出Excel" onclick="getReferenceForm(this).action='${ctx}/pages/SampleInfo/listExcel.do'"/>

		<div>
	</div>

	<div class="gridTable">

		<simpletable:pageToolbar page="${page}">
		</simpletable:pageToolbar>

		<table width="100%"  border="0" cellspacing="0" class="gridBody">
		  <thead>

			  <tr>
				<th style="width:1px;"> </th>
				<th style="width:1px;"><input type="checkbox" onclick="setAllCheckboxState('items',this.checked)"></th>

				<!-- 排序时为th增加sortColumn即可,new SimpleTable('sortColumns')会为tableHeader自动增加排序功能; -->
				<th sortColumn="sample_number" ><%=SampleInfo.ALIAS_SAMPLE_NUMBER%></th>
				<th sortColumn="sample_date" ><%=SampleInfo.ALIAS_SAMPLE_DATE%></th>
				<th sortColumn="sampled_unit_name" ><%=SampleInfo.ALIAS_SAMPLED_UNIT_NAME%></th>
				<th sortColumn="unit_kind" ><%=SampleInfo.ALIAS_UNIT_KIND%></th>
				<th sortColumn="sample_unit" ><%=SampleInfo.ALIAS_SAMPLE_UNIT%></th>
				<th sortColumn="sample_product" ><%=SampleInfo.ALIAS_SAMPLE_PRODUCT%></th>
				<th sortColumn="product_type" ><%=SampleInfo.ALIAS_PRODUCT_TYPE%></th>
				<th sortColumn="amount" ><%=SampleInfo.ALIAS_AMOUNT%></th>
				<th sortColumn="batch_number" ><%=SampleInfo.ALIAS_BATCH_NUMBER%></th>
				<th sortColumn="sample_kind" ><%=SampleInfo.ALIAS_SAMPLE_KIND%></th>
				<th sortColumn="report_number" ><%=SampleInfo.ALIAS_REPORT_NUMBER%></th>
				<th sortColumn="report_date" ><%=SampleInfo.ALIAS_REPORT_DATE%></th>
				<th sortColumn="report_result" ><%=SampleInfo.ALIAS_REPORT_RESULT%></th>
				<th sortColumn="receive_report_date" ><%=SampleInfo.ALIAS_RECEIVE_REPORT_DATE%></th>
				<th sortColumn="sample_year" ><%=SampleInfo.ALIAS_SAMPLE_YEAR%></th>

				<th>操作</th>
			  </tr>

		  </thead>
		  <tbody>
		  	  <c:forEach items="${page.result}" var="item" varStatus="status">

			  <tr class="${status.count % 2 == 0 ? 'odd' : 'even'}">
				<td>${page.thisPageFirstElementNumber + status.index}</td>
				<td><input type="checkbox" name="items" value="sampleInfoId=${item.sampleInfoId}&"></td>

				<td><c:out value='${item.sampleNumber}'/>&nbsp;</td>
				<td><c:out value='${item.sampleDateString}'/>&nbsp;</td>
				<td><c:out value='${item.sampledUnitName}'/>&nbsp;</td>
				<td><c:out value='${item.unitKind}'/>&nbsp;</td>
				<td><c:out value='${item.sampleUnit}'/>&nbsp;</td>
				<td><c:out value='${item.sampleProduct}'/>&nbsp;</td>
				<td><c:out value='${item.productType}'/>&nbsp;</td>
				<td><c:out value='${item.amount}'/>&nbsp;</td>
				<td><c:out value='${item.batchNumber}'/>&nbsp;</td>
				<td><c:out value='${item.sampleKind}'/>&nbsp;</td>
				<td><c:out value='${item.reportNumber}'/>&nbsp;</td>
				<td><c:out value='${item.reportDateString}'/>&nbsp;</td>
				<td><c:out value='${item.reportResult}'/>&nbsp;</td>
				<td><c:out value='${item.receiveReportDateString}'/>&nbsp;</td>
				<td><c:out value='${item.sampleYear}'/>&nbsp;</td>
				<td>
					<a href="${ctx}/pages/SampleInfo/show.do?sampleInfoId=${item.sampleInfoId}&">查看</a>&nbsp;&nbsp;&nbsp;
					<a href="${ctx}/pages/SampleInfo/edit.do?sampleInfoId=${item.sampleInfoId}&">修改</a>
				</td>
			  </tr>

		  	  </c:forEach>
		  </tbody>
		</table>

		<simpletable:pageToolbar page="${page}">
		</simpletable:pageToolbar>
	</div>
	</form>
</rapid:override>

<%-- jsp模板继承,具体使用请查看: http://code.google.com/p/rapid-framework/wiki/rapid_jsp_extends --%>
<%@ include file="base.jsp" %>

